Using a new paradigm, we estimate gene vulnerability and/or resistance using CRISPRi and the interacitivty with drugs in Acinetobacter baumannii.
# https://jgeb.springeropen.com/articles/10.1186/s43141-020-00048-4
interested.genes <- c(
"accA",
"accB",
"accC",
"accD",
"murA", #transferase
"murG", #transferase
"mraY", #transferase
"murC", #ligase
"murD", #ligase
"murE", #ligase
"murF", #ligase
"murB", #oxidoreductase
"murJ",
"dnaB",
"psd",
"asd",
"nuoA",
"nuoB",
"nuoC",
"nuoE",
"nuoB",
"nuoF",
"lpxC",
"nuoH",
"nuoG",
"nuoI",
"nuoJ",
"nuoK",
"nuoL",
"nuoM",
"nuoN",
"aroA",
"aroC",
"aroQ",
"nuoB",
"thiD",
"GO593_00515",
"folB",
"folE",
"folK",
"ftsA",
"ftsI",
"gatB",
"nphR_2",
"argS",
"ispG",
"ppa",
"lolB",
"ihfB",
"tsaD")
interested.conditions <- c(
"None_0_T1 - None_0_T0",
"None_0_T2 - None_0_T0",
"Colistin_0.44_T1 - None_0_T0",
"Colistin_0.44_T2 - None_0_T0",
"Rifampicin_0.34_T1 - None_0_T0",
"Rifampicin_0.34_T2 - None_0_T0",
"Meropenem_0.11_T1 - None_0_T0",
"Meropenem_0.17_T1 - None_0_T0",
"Meropenem_0.11_T2 - None_0_T0",
"Meropenem_0.17_T2 - None_0_T0",
"Imipenem_0.06_T1 - None_0_T0",
"Imipenem_0.06_T2 - None_0_T0",
"Imipenem_0.09_T1 - None_0_T0",
"Imipenem_0.09_T2 - None_0_T0")
require(conflicted)
## Loading required package: conflicted
require(pacman)
## Loading required package: pacman
p_load(
"data.table",
"tidyverse",
"broom",
"modelr",
"viridis")
p_load_current_gh(
"DoseResponse/drcData",
"ryandward/drc",
"hrbrmstr/hrbrthemes")
conflict_prefer("gaussian", "drc")
## [conflicted] Will prefer drc::gaussian over any other package
conflict_prefer("select", "dplyr")
## [conflicted] Will prefer dplyr::select over any other package
conflict_prefer("filter", "dplyr")
## [conflicted] Will prefer dplyr::filter over any other package
doc_theme <- theme_ipsum(
base_family = "Arial",
caption_margin = 12,
axis_title_size = 12,
axis_col = "black")
melted_results <- fread(
"../../Results/melted_results.tsv.gz", sep = "\t")
interest <- fread(
"../../interest.tsv", sep = "\t")
curated_names <- fread(
"../../curated_names.tsv", sep = "\t")
# function to rescale between 0 and 1
range01 <- function(x){(x - min(x))/(max(x) - min(x))}
melted_results[!is.na(y_pred), y_pred := range01(y_pred)]
melted_results <- tibble(melted_results)
drm.parameters <- c("hill", "min_value", "max_value", "kd_50")
lower_range <- min(melted_results$y_pred, na.rm = T)
upper_range <- max(melted_results$y_pred, na.rm = T)
drm.try <- possibly(drm, otherwise = NA)
augment.try <- possibly(augment, otherwise = NA)
mismatches <- melted_results %>%
filter(condition %in% interested.conditions) %>%
filter(unique_name %in% interested.genes) %>%
filter(type == "mismatch") %>%
nest(data = c(-condition, -unique_name))
mismatches <- mismatches %>%
mutate(fit = map(data, ~ drm.try(data = .x, LFC.adj ~y_pred, fct = L.4(names = drm.parameters))))
mismatches <- mismatches %>%
mutate(results = map(fit, glance)) %>%
mutate(p.vals = map(fit, tidy)) %>%
mutate(results = map(results, ~mutate(.x, logLik = c(logLik)))) %>%
unnest(results)
mismatches <- mismatches %>%
mutate(
kd_50.tibble = map(
p.vals,
~filter(.x, term == 'kd_50') %>%
select(p.value) %>%
rename (., vuln.p = p.value))) %>%
mutate(
vuln.tibble = map2(
fit,
p.vals,
~augment.try(
.x,
newdata = .y %>% filter (term == "kd_50") %>% select (estimate)) %>%
rename (., vuln.est = .fitted, vuln.kd_50 = estimate))) %>%
mutate(
hill.tibble = map(
p.vals,
~filter(.x, term == 'hill') %>%
select(estimate, p.value) %>%
rename (., hill.est = estimate, hill.p = p.value)))
mismatches <- mismatches %>%
unnest(vuln.tibble) %>%
unnest(kd_50.tibble) %>%
unnest(hill.tibble) %>%
select(-c(p.vals))
mismatches <- mismatches %>%
mutate(Gene = factor(unique_name, levels = unique(interested.genes))) %>%
mutate(Condition = factor(condition, levels = unique(interested.conditions)))
Create a new tibble that contains a summary dataset of each gene in each condition. Useful for computing parameter estimates once, then saving for later.
vuln.summary <- mismatches %>% select(
unique_name,
condition,
vuln.est,
vuln.kd_50,
vuln.p,
hill.est,
hill.p,
logLik)
# fwrite(vuln.summary, "../../vulnerability_summary.tsv", sep = "\t")
mismatches <- mismatches %>%
mutate(predictions = map2(fit, data, ~augment.try(
.x,
newdata = expand.grid(
y_pred = seq(
min(.y$y_pred),
max(.y$y_pred),
length = 250)),
conf.int = T,
conf.level = 0.90)))
fit_predictions <- mismatches %>%
select(Gene, Condition, predictions) %>%
unnest(predictions)
fit_points <- mismatches %>%
select(Gene, Condition, data) %>%
unnest(data)
plot.genes <- c("nphR_2", "murE", "argS", "ispG", "ppa")
plot.conditions <- c("None_0_T2 - None_0_T0")
plot.title <- bquote(bold("Slow to highly vulnerable" ~ at ~ t[2] ~ 'after Induction,' ~ 'CI = 0.9'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 0.65,
size = 1.5,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 3.5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.25,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_brewer(palette = "Set1") +
scale_color_brewer(palette = "Set1") +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("aroC", "murA", "ftsI")
plot.conditions <- c("None_0_T2 - None_0_T0")
plot.title <- bquote(bold("Highly vulnerable" ~ at ~ t[2] ~ 'after Induction,' ~ 'CI = 0.9'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 0.65,
size = 1.5,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 3.5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.25,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_brewer(palette = "Set1") +
scale_color_brewer(palette = "Set1") +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("lolB", "ihfB", "tsaD")
plot.conditions <- c("None_0_T2 - None_0_T0")
plot.title <- bquote(bold("No response" ~ at ~ t[2] ~ 'after Induction,' ~ 'CI = 0.9'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 0.65,
size = 1.5,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 3.5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.25,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_brewer(palette = "Set2") +
scale_color_brewer(palette = "Set2") +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("ftsI")
plot.conditions <- c("None_0_T2 - None_0_T0", "Meropenem_0.11_T2 - None_0_T0", "Meropenem_0.17_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(ftsI) ~ vulnerability ~ at ~ t[1] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
# coord_cartesian(
# ylim = c(
# mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
# mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("folK")
plot.conditions <- c("None_0_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(folK) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("dnaB")
plot.conditions <- c("Imipenem_0.09_T2 - None_0_T0", "Imipenem_0.06_T2 - None_0_T0")
plot.title <- bquote(bold(dnaB~~vulnerability ~ at ~ t[2] ~ 'in Imipenem 0.09,' ~ 'ci = 0.9'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_brewer(palette = "Set1") +
scale_color_brewer(palette = "Set1") +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("murF", "murA", "mraY")
plot.conditions <- c("Imipenem_0.09_T1 - None_0_T0")
plot.title <- bquote(bold(PG~vulnerability ~ at ~ t[1] ~ 'in Imipenem,' ~ 'CI = 0.9'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_brewer(palette = "Set1") +
scale_color_brewer(palette = "Set1") +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("murC", "murD", "murE", "murF", "murB", "murJ")
plot.conditions <- c("Imipenem_0.09_T1 - None_0_T0")
plot.title <- bquote(bold(PG~ligase~and~redox~vulnerability ~ at ~ t[1] ~ 'in Imipenem 0.09,' ~ 'ci = 0.9'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("murG")
plot.conditions <- c("None_0_T1 - None_0_T0", "Meropenem_0.11_T1 - None_0_T0", "Meropenem_0.17_T1 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(murG) ~ vulnerability ~ at ~ t[1] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
# coord_cartesian(
# ylim = c(
# mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
# mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("murC")
plot.conditions <- c("None_0_T1 - None_0_T0", "Meropenem_0.11_T1 - None_0_T0", "Meropenem_0.17_T1 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(murC) ~ vulnerability ~ at ~ t[1] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
# coord_cartesian(
# ylim = c(
# mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
# mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("nuoB")
plot.conditions <- c("None_0_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(nuoB) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("nuoE")
plot.conditions <- c("None_0_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(nuoE) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("thiD")
plot.conditions <- c("None_0_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(thiD) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("gatB")
plot.conditions <- c("None_0_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(gatB) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("lpxC")
plot.conditions <- c("None_0_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0", "Meropenem_0.11_T2 - None_0_T0", "Meropenem_0.11_T1 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(lpxC) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("nuoM")
plot.conditions <- c("None_0_T2 - None_0_T0", "Imipenem_0.06_T2 - None_0_T0", "Imipenem_0.09_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(nuoM) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("nuoH")
plot.conditions <- c("None_0_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(nuoH) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("nuoB")
plot.conditions <- c("None_0_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(nuoB) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- curated_names %>% filter(unique_name %like% "nuoI") %>% pull(unique_name)
plot.conditions <- c("None_0_T1 - None_0_T0", "Rifampicin_0.34_T1 - None_0_T0", "Colistin_0.44_T1 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(nuoI) ~ vulnerability ~ at ~ t[1] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("psd")
plot.conditions <- c("None_0_T2 - None_0_T0", "Rifampicin_0.34_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0")
plot.title <- bquote(bold(Gene ~ bolditalic(psd) ~ vulnerability ~ at ~ t[2] ~ '(CI = 90%)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Condition)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Condition)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Condition)) +
scale_fill_viridis(discrete = TRUE, direction = -1) +
scale_color_viridis(discrete = TRUE, direction = -1) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max()))
print(plot.graphic)
plot.genes <- c("lpxC", "nuoB")
plot.conditions <- c("Colistin_0.44_T2 - None_0_T0")
plot.title <- bquote(bold(Vulnerability ~ at ~ t[2] ~ 'in Colistin 0.44,' ~ 'CI = 0.9'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_brewer(palette = "Set1") +
scale_color_brewer(palette = "Set1") +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
plot.genes <- c("lpxC", "nuoB")
plot.conditions <- c("Rifampicin_0.34_T2 - None_0_T0")
plot.title <- bquote(bold(Vulnerability ~ at ~ t[2] ~ 'in Rifampicin 0.34,' ~ 'CI = 0.9'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_manual(values = ipsum_pal()(3)[2:3]) +
scale_colour_manual(values = ipsum_pal()(3)[2:3]) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title)
print(plot.graphic)
Manually curated final plot for LOS and nuo story.
plot.genes <- c("lpxC", "nuoB")
plot.conditions <- c("Rifampicin_0.34_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0")
plot.labeller <- as_labeller(
c(
`Rifampicin_0.34_T2 - None_0_T0` = "Rifampicin",
`Colistin_0.44_T2 - None_0_T0` = "Colistin"))
plot.title <- bquote(bold(Vulnerability ~ at ~ t[2] ~ '(Confidence = 0.90)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
mutate(label = gsub("", "", Condition)) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_manual(values = ipsum_pal()(3)[2:3]) +
scale_colour_manual(values = ipsum_pal()(3)[2:3]) +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title) +
facet_wrap(
facets = ~ Condition,
labeller = plot.labeller)
print(plot.graphic)
Manually curated final plot for acc story.
plot.genes <- c("accA", "accB", "accC", "accD")
plot.conditions <- c("Rifampicin_0.34_T2 - None_0_T0", "Colistin_0.44_T2 - None_0_T0")
plot.labeller <- as_labeller(
c(
`Rifampicin_0.34_T2 - None_0_T0` = "Rifampicin",
`Colistin_0.44_T2 - None_0_T0` = "Colistin"))
plot.title <- bquote(bold(Vulnerability ~ at ~ t[2] ~ '(Confidence = 0.90)'))
plot.graphic <- fit_predictions %>%
filter(
Gene %in% plot.genes &
Condition %in% plot.conditions) %>%
mutate(label = gsub("", "", Condition)) %>%
ggplot() +
geom_hline(
yintercept = 0,
linetype = "dashed",
color = "black",
size = 0.5) +
geom_line(
alpha = 1,
size = 2,
aes(
x = y_pred,
y = .fitted,
color = Gene)) +
geom_point(
data = fit_points %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
shape = 20,
size = 5,
aes(
x = y_pred,
y = LFC.adj,
color = Gene)) +
geom_ribbon(
data = fit_predictions %>% filter(
Gene %in% plot.genes &
Condition %in% plot.conditions),
alpha = 0.30,
aes(
x = y_pred,
y = .fitted,
ymin = .lower,
ymax = .upper,
fill = Gene)) +
scale_fill_brewer(palette = "Set1") +
scale_color_brewer(palette = "Set1") +
xlab("Predicted Knockdown") +
ylab("Log-2 Fitness Foldchange") +
xlim(
0,
mismatches %>% unnest(data) %>% select(y_pred) %>% max()) +
coord_cartesian(
ylim = c(
mismatches %>% unnest(data) %>% select(LFC.adj) %>% min(),
mismatches %>% unnest(data) %>% select(LFC.adj) %>% max())) +
doc_theme +
theme(legend.position = "bottom") +
ggtitle(plot.title) +
facet_wrap(
facets = ~ Condition,
labeller = plot.labeller)
print(plot.graphic)